<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:composite="http://java.sun.com/jsf/composite">
<composite:interface>
	<composite:attribute name="userDto" type="com.home.model.dto.UserDto" />
</composite:interface>

<composite:implementation>
		 <f:event type="preRenderComponent" listener="#{accountComponentBean.initData}"/>
		<div class="form-group">
			<label class="control-label" for="userName">#{msg['com.home.component.accountComponent.username']}</label>
			<p:inputText id="userName" styleClass="form-control"
				value="#{cc.attrs.userDto.accountDto.userName}" />
		</div>
		<div class="form-group">
			<label class="control-label" for="firstName">#{msg['com.home.component.accountComponent.firstName']}</label>
			<p:inputText id="firstName" styleClass="form-control"
				value="#{cc.attrs.userDto.firstName}" />
		</div>
		<div class="form-group">
			<label class="control-label" for="lastName">#{msg['com.home.component.accountComponent.lastName']}</label>
			<p:inputText id="lastName" styleClass="form-control"
				value="#{cc.attrs.userDto.lastName}" />
		</div>
		<div class="form-group">
			<label class="control-label" for="gender">#{msg['com.home.component.accountComponent.gender']}</label>
			<p:selectOneRadio id="gender" value="#{cc.attrs.userDto.gender}">
	            <f:selectItem itemLabel="#{msg['com.home.component.accountComponent.male']}" itemValue="1" />
	            <f:selectItem itemLabel="#{msg['com.home.component.accountComponent.feMale']}" itemValue="2" />
	            <f:selectItem itemLabel="#{msg['com.home.component.accountComponent.genderOther']}" itemValue="3" />
	        </p:selectOneRadio>
		</div>
		<div class="form-group">
			<label class="control-label" for="address">#{msg['com.home.component.accountComponent.address']}</label>
			<p:inputText id="address" styleClass="form-control"
				value="#{cc.attrs.userDto.address}" />
		</div>
		<div class="form-group">
			<label class="control-label" for="phone">#{msg['com.home.component.accountComponent.phone']}</label>
			<p:inputText id="phone" styleClass="form-control"
				value="#{cc.attrs.userDto.phone}" />
		</div>
		<div class="form-group">
			<label class="control-label" for="city">#{msg['com.home.component.accountComponent.city']}</label>
			<h:selectOneMenu id="city" styleClass="form-control" value="#{cc.attrs.userDto.cityDto}" >
				<f:selectItems value="#{accountComponentBean.cities}" var="city" itemLabel="#{city.name}" itemValue="#{city.id}"/>
			</h:selectOneMenu>
		</div>
		
</composite:implementation>
</html>
